home *** CD-ROM | disk | FTP | other *** search
- /* ---------------------------------------------------------------------------------------------
- Find_icon, code for constructing icon suites for files and folders
-
- by James W. Walker
- preferred e-mail: <mailto:jwwalker@kagi.com>
- alternate e-mail: <mailto:jwwalker@aol.com>, <jim@nisus-soft.com>
- web: <http://users.aol.com/jwwalker/>
-
- File: DTGetIconSuite.h
-
- Copyright ©1997 by James W. Walker
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours.
- If you're going to re-distribute the source, please make it clear
- that the code was descended from James W. Walker's code,
- but that you've made changes.
- ---------------------------------------------------------------------------------------------
- */
-
- #ifndef __ICONS__
- #include <Icons.h>
- #endif
-
- pascal OSErr DTGetIconSuite(
- /* --> */ short vRefNum,
- /* --> */ IconSelectorValue iconTypes,
- /* --> */ OSType fileCreator,
- /* --> */ OSType fileType,
- /* <-- */ Handle *iconSuite);
- /* ¶ Get an icon suite from the desktop database or the Desktop file.
- The suite is returned as a newly created Handle. Your program is
- responsible for disposing of the suite when it is done using the icon.
- The individual icons are retrieved using the MoreFiles function
- DTGetIcon. SInce DTGetIcon does not handle "mini" icons (12x16),
- DTGetIconSuite does not add "mini" icons to the suite.
-
- vRefNum input: Volume specification.
- iconTypes input: an icon type mask, as defined in <Icons.h>.
- For instance, kSelectorAllAvailableData.
- fileCreator input: The icon's creator type.
- fileType input: The icon's file type.
- iconSuite output: A Handle containing the newly created icon suite.
-
- Result codes include:
- noErr 0 No error
- nsvErr -35 Volume not found
- ioErr -36 I/O error
- paramErr -50 Volume doesn't support this function
- memFullErr -108 iconHandle could not be allocated
- desktopDamagedErr -1305 The desktop database has become corrupted -
- the Finder will fix this, but if your
- application is not running with the
- Finder, use PBDTReset or PBDTDelete
- afpItemNotFound -5012 Information not found
- noMaskFoundErr -1000 no 'ICN#' or 'ics#' was found
- */
-